const { MongoClient } = require('mongodb');

const url = 'mongodb://121.36.217.123:10010'
const client = new MongoClient(url)

const dbName = 'user'

async function main(){
    await client.connect()
    const db = client.db(dbName)
    const collection = db.collection('user');
    var result = await collection.find({}).toArray()
    return result
}
/* main().then(res=>{
    console.log(res);
}) */
module.exports = main